package com.ylx.controller;

import com.ylx.model.common.dtos.ResponseResult;
import com.ylx.model.user.dtos.LoginDto;
import com.ylx.model.user.pojo.PxxAdmin;
import com.ylx.service.PxxAdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
@Api(tags = "AdminLoginController-管理端口登录注册")
@RestController
@RequestMapping("/api/admin/login")
@Slf4j
public class AdminLoginController {
    /**
     * 登录
     */
    @Resource
    private PxxAdminService pxxUserService;
    @ApiOperation("登录方法")
    @PostMapping("/login")
    public ResponseResult login(@RequestBody LoginDto loginDto){

        return  pxxUserService.login(loginDto);
    }

    /**
     * 注册
     * @param pxxUser
     * @return
     */
    @ApiOperation("注册方法")
    @PostMapping("/regist")
    public ResponseResult regist(@RequestBody PxxAdmin pxxUser){

        return  pxxUserService.regist(pxxUser);
    }








}

